package cn.bjxy.shishaolong.system.exception;

import lombok.Getter;

import java.io.Serializable;

/**
 * 自定义操作失败异常
 * @author 时少龙
 * @since 2019.03.10
 */
@Getter
public class OperatorFailureException extends RuntimeException implements Serializable {

    private int code;

    public OperatorFailureException() {
        super();
    }

    public OperatorFailureException(int code,String message) {
        super(message);
        this.code = code;
    }

    public OperatorFailureException(String message, Throwable cause) {
        super(message, cause);
    }

    public OperatorFailureException(Throwable cause) {
        super(cause);
    }

    public OperatorFailureException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public OperatorFailureException setCode(int code){
        this.code = code;
        return this;
    }
}
